package com.spring.demo.staticproxy;

/**
 * @version 1.0.0
 * @Date: 2022/5/30 11:19
 * @Author ZhuYouBin
 * @Description
 */
/** 代理对象类 */
public class Proxy implements AbstractInterface {
    /** 通过组合的方式添加目标对象 */
    private Target target;

    public Proxy(Target target) {
        this.target = target;
    }

    @Override
    public void buyHouse() {
        System.out.println("Proxy: 找代理对象帮我去购买房子......");
        target.buyHouse();
        System.out.println("Proxy: 代理对象帮我把房子购买好了......");
    }
}
